<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>


</head>

<body>
    <div id="box">
        <!-- <span v-for="item in user">{{getInfo(item)}}<br></span> -->
        <span>{{info}}</span>
    </div>

</body>

<script src="https://cdn.bootcss.com/vue/2.6.11/vue.js"></script>
<script>
    new Vue({
        el: '#box',
        data: {
            user: [{
                id: 110,
                name: '小红',
                age: 21
            }, {
                id: 120,
                name: '小名',
                age: 19
            }, {
                id: 130,
                name: '小敏',
                age: 22
            }, {
                id: 140,
                name: '小潇',
                age: 20
            }, ],
        },
        computed: {
            info: function() {
                var str = '';
                for (var item of this.user) {
                    str += item.id + '  ' + item.name + '  ' + item.age;
                }
                return str;
            }
        },
        /* methods: {
            getInfo: function(user) {
                return user.id + '  ' + user.name + '  ' + user.age;
            }
        } */
    })
</script>

</html>